// "实名认证" 页面

import React, { Component } from 'react'
import pxPage from '../../../root/pxPage'
import { getMsg, errToast, businessHeader } from '../../../redux/actionCreator'
import { withRouter } from "react-router-dom"
import { connect } from 'react-redux'

const deviceHight = document.documentElement.clientHeight

class Accountsafe_bus extends Component {
    constructor(props) {
        super(props);
        let modify = getMsg(this.props)
        this.state = {
            // multiple: false,
            business_id: modify.business_id,
            business_header: '',
            business_number: '',//身份证
            // business_password_en: '',
        }


        this.handleChangepasswordnew = this.handleChangepasswordnew.bind(this)
        // this.handleChangepassworden = this.handleChangepassworden.bind(this)
        // this.handleChangepasswordold = this.handleChangepasswordold(this)

    }


    handleChangepasswordnew = (e) => {
        this.setState({ business_number: e.target.value })
    }
    // handleChangepassworden = (e) => {
    //     this.setState({ business_number: e.target.value })
    // }
    // handleChangepasswordold = (e) => {
    //     this.setState({ user_password_old: e.target.value })
    // }
    render() {

        return (
            <div style={{ minHeight: '100vh', display: 'flex', width: '100%' }}>

                <div style={{ backgroundColor: "#080904", minHeight: '100vh', display: 'flex', width: '100%' }}>

                    <div style={{ width: '90%', margin: '0 auto' }}>
                        <div style={{ height: '20px' }}></div>
                        <i className="iconfont icon-fanhui" style={{ fontSize: '1.7em' }} onClick={() => this.props.history.goBack()}></i>
                        <div style={{ fontSize: '1.5em', fontWeight: 'bold', paddingTop: '25px', paddingBottom: '20px' }}>修改密码</div>
                        <div style={accountsoft_addspdiv}>
                            <div className='addsp-div-div' style={accountsoft_addspdivdiv}>

                                <div style={accountsoft_addspdivpre}>姓名</div>
                                <div style={accountsoft_addspdiveit}>身份证号码</div>
                                {/* <div style={accountsoft_addspdivnine}>确认密码</div> */}

                                {/* 密码 */}
                                <input
                                    // value={this.state.user_password_old}
                                    className='addsp-form-input-three'
                                    type="text"
                                    placeholder="请输入姓名"
                                    style={accountsoft_addspinputthree}
                                    onChange={(e) => { this.setState({ business_header: e.target.value }) }}
                                ></input>
                                <input
                                    className='addsp-form-input-six'
                                    style={accountsoft_addspinputsix}
                                    placeholder='输入身份证号码'
                                    type='number'
                                    value={this.state.business_password_new}
                                    onChange={this.handleChangepasswordnew}
                                ></input>

                                {/* <input
                                    className='addsp-form-input-sen'
                                    style={aaccountsoft_addspinputsen}
                                    placeholder='确认密码'
                                    type='password'
                                    value={this.state.business_password_en}
                                    onChange={this.handleChangepassworden}
                                ></input> */}

                            </div>
                            <div className='addsp-div-div-two' style={accountsoft_addspdivdivtwo}>
                                <div
                                    style={accountsoft_addspdivdivtwoi}
                                    onClick={() => {
                                        this.props.dispatch(businessHeader(this.state.business_id, this.state.business_header, this.props))
                                        console.log(this.state)
                                    }}
                                >
                                    <i style={{ fontSize: pxPage(44) }} className='iconfont icon-duigou'></i>
                                </div>
                                <div
                                    style={accountsoft_addspdivdivtwoii}
                                    onClick={() => {
                                        this.props.history.goBack()

                                    }}
                                >
                                    <i style={{ fontSize: pxPage(44) }} className='iconfont icon-cancel'></i>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
                <div style={{ flex: '1' }}></div>
            </div>
        )
    }
}
const mapStateToProps = (state) => ({
    login: state.login,
})
export default withRouter(connect(mapStateToProps)(Accountsafe_bus))

const accountsoft_addspdiv = {
    width: '100%',
    // height: `${deviceHight - 30}px`,
    paddingTop: pxPage(15),
    borderTop: '1px solid #fff'
}
const accountsoft_addspdivdiv = {
    // width: pxPage(338),
    height: `${deviceHight - 430}px`,
    backgroundColor: 'rgb(212, 118, 102)'
}
const accountsoft_addspdivdivtwo = {
    width: '100%',
    // height: pxPage(50),
    position: 'relative',
    backgroundColor: 'black'
}
const accountsoft_addspdivdivtwoi = {
    position: 'absolute',
    left: pxPage(64),
    top: pxPage(15),
    fontSize: pxPage(44)
}
const accountsoft_addspdivdivtwoii = {
    position: 'absolute',
    right: pxPage(64),
    top: pxPage(15),
    fontSize: pxPage(44)
}

// 输入框样式
//输入旧密码
const accountsoft_addspinputthree = {
    width: pxPage(170),
    height: pxPage(30),
    position: 'absolute',
    right: pxPage(30),
    top: pxPage(180),
    padding: pxPage(8),
    borderRadius: pxPage(10)
}
//输入新密码
const accountsoft_addspinputsix = {
    width: pxPage(170),
    height: pxPage(30),
    position: 'absolute',
    right: pxPage(30),
    top: pxPage(250),
    padding: pxPage(8),
    borderRadius: pxPage(10)
}
//确认旧密码
const aaccountsoft_addspinputsen = {
    width: pxPage(170),
    height: pxPage(30),
    position: 'absolute',
    right: pxPage(30),
    top: pxPage(320),
    padding: pxPage(8),
    borderRadius: pxPage(10)
}

//左侧文本

//旧密码
const accountsoft_addspdivpre = {
    width: pxPage(160),
    height: pxPage(30),
    position: 'absolute',
    left: pxPage(60),
    top: pxPage(200),
    fontSize: pxPage(15)
}

//新密码
const accountsoft_addspdiveit = {
    width: pxPage(160),
    height: pxPage(30),
    position: 'absolute',
    left: pxPage(60),
    top: pxPage(270),
    fontSize: pxPage(15)
}

//确认密码
const accountsoft_addspdivnine = {
    width: pxPage(160),
    height: pxPage(30),
    position: 'absolute',
    left: pxPage(60),
    top: pxPage(340),
    fontSize: pxPage(15),
}
